-
Notifications
You must be signed in to change notification settings - Fork 24
Better detect unreferenced definitions in the linter #595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Juan Cruz Viotti <[email protected]>
🤖 Augment PR SummarySummary: This PR re-enables and improves detection of unreferenced schema definitions in the linter by updating the vendored Changes:
Technical Notes: The linter rule inventory grows (rule list counts updated), and orphan detection now explicitly considers references coming from outside the definitions containers. 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| auto operator()(const sourcemeta::core::Pointer::Token &token) const noexcept | ||
| -> void { | ||
| this->output_ << SEPARATOR; | ||
| encode_string_or_empty(this->output_, token.to_property()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TokenVisitor::operator()(const Pointer::Token&) unconditionally calls token.to_property(), but PointerTemplate can contain index tokens (e.g. { "foo", 1, "bar" }), which will trip the to_property() assert at runtime. It seems worth handling token.is_index() (or explicitly constraining mangle to property-only templates) to avoid crashes.
🤖 Was this useful? React with 👍 or 👎
| for (const auto character : input) { | ||
| const auto unsigned_character{static_cast<unsigned char>(character)}; | ||
|
|
||
| if (is_ascii_alpha(unsigned_character)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encode_prefix() doesn’t appear to apply the same “reserved at segment start” handling described in the public doc comment for mangle (e.g. distinguishing x/X/X.. escape prefixes), which can lead to prefix collisions. If mangle is meant to be collision-free for arbitrary prefixes, it may be worth aligning prefix encoding with the documented rules (or documenting allowed prefix constraints).
🤖 Was this useful? React with 👍 or 👎
⚠️ **CAUTION: this is a major update, indicating a breaking change!**⚠️ This MR contains the following updates: | Package | Update | Change | |---|---|---| | [sourcemeta/jsonschema](https://github.com/sourcemeta/jsonschema) | major | `v13.6.0` → `v14.0.2` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>sourcemeta/jsonschema (sourcemeta/jsonschema)</summary> ### [`v14.0.2`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.0.2) [Compare Source](sourcemeta/jsonschema@v14.0.1...v14.0.2) #### What's Changed - feat: order lint errors by line number by [@​Karan-Palan](https://github.com/Karan-Palan) in [#​599](sourcemeta/jsonschema#599) **Full Changelog**: <sourcemeta/jsonschema@v14.0.1...v14.0.2> ### [`v14.0.1`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.0.1) [Compare Source](sourcemeta/jsonschema@v14.0.0...v14.0.1) #### What's Changed - Use an array of bytes for `compile --include` by [@​jviotti](https://github.com/jviotti) in [#​598](sourcemeta/jsonschema#598) **Full Changelog**: <sourcemeta/jsonschema@v14.0.0...v14.0.1> ### [`v14.0.0`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.0.0) [Compare Source](sourcemeta/jsonschema@v13.6.0...v14.0.0) #### What's Changed - Better detect unreferenced definitions in the linter by [@​jviotti](https://github.com/jviotti) in [#​595](sourcemeta/jsonschema#595) - Generate C/C++ headers in `compile` using `--include` (like `xxd`) by [@​jviotti](https://github.com/jviotti) in [#​596](sourcemeta/jsonschema#596) - Remove instance location information from the `inspect` command by [@​jviotti](https://github.com/jviotti) in [#​597](sourcemeta/jsonschema#597) **Full Changelog**: <sourcemeta/jsonschema@v13.6.0...v14.0.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi42OS4yIiwidXBkYXRlZEluVmVyIjoiNDIuNjkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1ham9yIl19-->
Signed-off-by: Juan Cruz Viotti [email protected]